﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>登陆</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <!--标准mui.css-->
    <link rel="stylesheet" href="../css/mui.min.css">
    <!--App自定义的css-->
    <script type="text/javascript" src="../js/lib/remtest.js"></script>
    <link rel="stylesheet" href="../css/zjteamapp.css" />
    <script type="text/javascript" src="../js/iconfont.js"></script>
    <style>
        .iconzs {
            width: 1em;
            height: 1em;
            vertical-align: -0.15em;
            fill: currentColor;
            overflow: hidden;
        }

        body {
            background: url(../images/loginbg.jpg) no-repeat center;
            font-family: "microsoft yahei";
        }

        .area {
            margin: 20px auto 0px auto;
        }

        .mui-input-group {
            margin-top: 10px;
        }

        .mui-input-group:first-child {
            margin-top: 20px;
        }

        .mui-input-group label {
            width: 22%;
        }

        .mui-input-row label~input,
        .mui-input-row label~select,
        .mui-input-row label~textarea {
            width: 78%;
        }

        .mui-checkbox input[type=checkbox],
        .mui-radio input[type=radio] {
            top: 6px;
        }

        .mui-content-padded {
            margin-top: 25px;
        }

        .mui-input-group {
            position: relative;
            padding: 0;
            border: 0;
            background-color: rgba(0, 0, 0, 0);
        }

        .mui-btn {
            
        }

        .link-area {
            display: block;
            margin-top: 25px;
            text-align: center;
        }

        .spliter {
            color: #bbb;
            padding: 0px 8px;
        }

        .oauth-area {
            position: absolute;
            bottom: 20px;
            left: 0px;
            text-align: center;
            width: 100%;
            padding: 0px;
            margin: 0px;
        }

        .oauth-area .oauth-btn {
            display: inline-block;
            width: 50px;
            height: 50px;
            background-size: 30px 30px;
            background-position: center center;
            background-repeat: no-repeat;
            margin: 0px 20px;
            /*-webkit-filter: grayscale(100%); */
            border: solid 1px #ddd;
            border-radius: 25px;
        }

        .oauth-area .oauth-btn:active {
            border: solid 1px #aaa;
        }

        .oauth-area .oauth-btn.disabled {
            background-color: #ddd;
        }

        .mui-input-group:before {
            position: absolute;
            top: 0;
            right: 0;
            left: 0;
            height: 0px;
            content: '';
            -webkit-transform: scaleY(.5);
            transform: scaleY(.5);
            background-color: #c8c7cc;
        }

        .mui-input-group:first-child {
            margin-top: 180px;
        }

        .mui-content-padded {
            margin-top: 50px;
        }

        .mui-btn-blue,
        .mui-btn-primary,
        input[type=submit] {
            color: #fff;
            border: 1px solid #ecb714;
            background-color: #ecb714;
            border-radius: 30px;
        }

        .link-area {
            display: block;
          position: absolute;
          bottom: 0.7rem;
          width: 100%;
            text-align: center;
            font-size: 0.24rem;
            
        }

        #forgetPasswordp {
            float: right;
            color: #b5b5b5;
            padding-top: 10px;
        }

        #forgetPasswordp a {
            color: #b5b5b5;
        }

        #forgetPasswordp:after {
            clear: both;
            content: "";
            height: 0px;
            display: block;
            visibility: hidden;
        }

        #login-form {
            width: 95%;
            margin: 0 auto;
        }

        .mui-input-group:after {
            position: absolute;
            right: 0;
            bottom: 0;
            left: 0;
            height: 0px;
            content: '';
            -webkit-transform: scaleY(.5);
            transform: scaleY(.5);
            background-color: #c8c7cc;
        }

        .link-area {
            color: #888888;
        }

        .link-area a {
            color: #ecb714;
        }

        .mui-btn-block {
            font-size: 0.3rem;
            display: block;
            width: 3.8rem;
            margin: 0 auto;
            margin-bottom: 0.3rem;
            color: #ffebad;
        }

        .mui-btn-block .iconzs {
            margin-right: 0.1rem;
        }
    </style>
</head>
<body>
	

	
	
	
	
	
	
    <div class="mui-content">
        <div style="text-align: center;margin: 0 auto; margin-top: 0.74rem; margin-bottom: 1.9rem; height: 0.78rem; width:1.38rem; ">
            <img src="../images/zclogo.png" width="100%">
        </div>
        <div class="mui-content-padded">
            <button id='loginw' class="mui-btn mui-btn-block mui-btn-primary">
                <svg class="iconzs">
                    <use xlink:href="#icon-weixindenglu"></use>
                </svg>微信登录
            </button>
            <!--<button id='loginq' class="mui-btn mui-btn-block mui-btn-primary"><svg class="iconzs" >
                                 <use xlink:href="#icon-QQdenglu"></use>
                            </svg>QQ登录</button>-->
            <button id='loginm' class="mui-btn mui-btn-block mui-btn-primary" style="background: rgba(0,0,0,0); color: #000000;">
                <svg class="iconzs">
                    <use xlink:href="#icon-shoujidenglu"></use>
                </svg>

                手机登录
            </button>
            <div class="link-area">
                没有账号？请
                <a id='reg' >注册></a>
            </div>
        </div>
        <div class="mui-content-padded oauth-area">
        </div>
    </div>
    <script type="text/javascript" src="../js/Common.js"></script>
    <script src="../js/mui.min.js"></script>
    <script src="../js/mui.enterfocus.js"></script>
 
    <script> 
        (function ($, doc) {
            $.init({
                statusBarBackground: '#f7f7f7'
            });
            $.plusReady(function () {

                var auths = null;
                // 扩展API加载完毕，现在可以正常调用扩展API
                plus.oauth.getServices(function (services) {
                    auths = services;
                    //判断是否登陆了
                    var s = auths[0];

                }, function (e) {
                    alert("获取分享服务列表失败：" + e.message + " - " + e.code);
                });
                // 登录操作
                function authLogin() {
                    var s = auths[0];
                    if (s.authResult) {
                        s.logout();
                    }
                    if (!s.authResult) {
                        s.login(function (e) {
                            //alert("登录认证成功！");
                            s.getUserInfo(function (e) {
                                //alert("获取用户信息成功：" + JSON.stringify(s.userInfo));
                                //plus.nativeUI.toast('登陆成功');
                                var state = {
                                    "LoginId": s.userInfo.unionid,
                                    "password": 'wx_pwd',
                                    "type": "wx",
                                    "userInfo": s.userInfo
                                };

                                localStorage.setItem('loginState', JSON.stringify(state));
                                //提交到服务器登陆日志
                                $.post('http://app.99990158.com/User/Login',{'UserKey':s.userInfo.unionid,'SRC':'wx','JsonInfo':JSON.stringify(s.userInfo)},function(res){
                                	console.log(JSON.stringify(res));
                                },'json');
                                
                                plus.nativeUI.toast('登陆成功');

                                var settingPage = plus.webview.getWebviewById('examples/setting.html');

                                settingPage.evalJS('ChangeHeadImg()');


                                //settingPage.show();

                                mui.back();
                                return;
                            }, function (e) {
                                alert("获取用户信息失败：" + e.message + " - " + e.code);
                            });
                        }, function (e) {
                            alert("登录认证失败！");
                        });
                    } else {
                        alert("已经登录认证！");
                    }
                }

                document.getElementById('loginw').addEventListener('tap', function () {
                    authLogin();
                });

                var main_loaded_flag = false;

                var mainPage = $.preload({
                    "id": 'user.html',
                    "url": 'user.html'
                });
                var toMain = function () {
                    $.fire(mainPage, 'show', null);
                    mainPage.show("pop-in");
                };
                 

            });

            doc.getElementById('loginm').addEventListener('tap', function () {
                window.location.href = 'login.html';
                return;
                //openWindowWithTitle('sub.html?url=login.html','登陆');
            });
            doc.getElementById('reg').addEventListener('tap', function () {
            
                openWindowWithTitle('register.html','注册');
            });
        }(mui, document));
    </script>
</body>
</html>